﻿#include "FITKRadiossSolverSettings.h"

namespace Radioss
{

    void FITKRadiossSolverRunExeTimeParam::setFinalTime(const double time)
    {
        _finalTime = time;
    }

    double FITKRadiossSolverRunExeTimeParam::getFinalTime() const
    {
        return _finalTime;
    }

    void FITKRadiossSolverGlobalTimeParam::setEnableMinTimeStep(const bool state)
    {
        _isEnableMinTimeStep = state;
    }

    bool FITKRadiossSolverGlobalTimeParam::isEnableMinTimeStep() const
    {
        return _isEnableMinTimeStep;
    }

    void FITKRadiossSolverGlobalTimeParam::setMinTimeStep(const double time)
    {
        _minTimeStep = time;
    }

    double FITKRadiossSolverGlobalTimeParam::getMinTimeStep() const
    {
        return _minTimeStep;
    }

    void FITKRadiossSolverGlobalTimeParam::setEnableScaleFactor(const bool state)
    {
        _isEnableScaleFactor = state;
    }

    bool FITKRadiossSolverGlobalTimeParam::isEnableScaleFactor() const
    {
        return _isEnableScaleFactor;
    }

    void FITKRadiossSolverGlobalTimeParam::setScaleFactor(const double s)
    {
        _scaleFactor = s;
    }

    double FITKRadiossSolverGlobalTimeParam::getScaleFactor() const
    {
        return _scaleFactor;
    }

    void FITKRadiossSolverNodalTimeStepControlParam::setTimeStepControlType(const NodalTimeStepControlType type)
    {
        _controlType = type;
    }

    FITKRadiossSolverNodalTimeStepControlParam::NodalTimeStepControlType FITKRadiossSolverNodalTimeStepControlParam::getTimeStepControlType() const
    {
        return _controlType;
    }

    void FITKRadiossSolverNodalTimeStepControlParam::setMinimumTimeStep(const double time)
    {
        _minTimeStep = time;
    }

    double FITKRadiossSolverNodalTimeStepControlParam::getMinimumTimeStep() const
    {
        return _minTimeStep;
    }

    void FITKRadiossSolverNodalTimeStepControlParam::setScaleFactor(const double s)
    {
        _scaleFactor = s;
    }

    double FITKRadiossSolverNodalTimeStepControlParam::getScaleFactor() const
    {
        return _scaleFactor;
    }

    void FITKRadiossSolverNodalTimeStepControlParam::setInitialAddMassRatio(const double r)
    {
        _initAddMassRatio = r;
    }

    double FITKRadiossSolverNodalTimeStepControlParam::getInitialAddMassRatio() const
    {
        return _initAddMassRatio;
    }

    void FITKRadiossSolverElementalTimeStepControlParam::setTimeStepControlType(const ElementalTimeStepControlType type)
    {
        _controlType = type;
    }

    FITKRadiossSolverElementalTimeStepControlParam::ElementalTimeStepControlType FITKRadiossSolverElementalTimeStepControlParam::getTimeStepControlType() const
    {
        return _controlType;
    }

    void FITKRadiossSolverElementalTimeStepControlParam::setMinimumTimeStep(const double time)
    {
        _minTimeStep = time;
    }

    double FITKRadiossSolverElementalTimeStepControlParam::getMinimumTimeStep() const
    {
        return _minTimeStep;
    }

    void FITKRadiossSolverElementalTimeStepControlParam::setNumberOfAddCards(const bool addCards)
    {
        _numberOfAddCards = addCards;
    }

    bool FITKRadiossSolverElementalTimeStepControlParam::getNumberOfAddCards() const
    {
        return _numberOfAddCards;
    }

    void FITKRadiossSolverElementalTimeStepControlParam::setMinAspectRatio(const double value)
    {
        _minAspectRatio = value;
    }

    double FITKRadiossSolverElementalTimeStepControlParam::getMinAspectRatio() const
    {
        return _minAspectRatio;
    }

    void FITKRadiossSolverElementalTimeStepControlParam::setMinVolumeRatio(const double value)
    {
        _minVolumeRatio = value;
    }

    double FITKRadiossSolverElementalTimeStepControlParam::getMinVolumeRatio() const
    {
        return _minVolumeRatio;
    }

    void FITKRadiossSolverElementalTimeStepControlParam::setScaleFactor(const double s)
    {
        _scaleFactor = s;
    }

    double FITKRadiossSolverElementalTimeStepControlParam::getScaleFactor() const
    {
        return _scaleFactor;
    }

    void FITKRadiossSolverAdaptiveDynamicRelaxation::setEnableDynamicRelaxation(const bool isEnable)
    {
        _enableDynamicRelaxation = isEnable;
    }

    bool FITKRadiossSolverAdaptiveDynamicRelaxation::getEnableDynamicRelaxation() const
    {
        return _enableDynamicRelaxation;
    }

    void FITKRadiossSolverAdaptiveDynamicRelaxation::setEnableStartTime(const bool isEnable)
    {
        _enableStartTime = isEnable;
    }

    bool FITKRadiossSolverAdaptiveDynamicRelaxation::isEnableStartTime() const
    {
        return _enableStartTime;
    }

    void FITKRadiossSolverAdaptiveDynamicRelaxation::setStartTime(const double time)
    {
        _startTime = time;
    }

    double FITKRadiossSolverAdaptiveDynamicRelaxation::getStartTime() const
    {
        return _startTime;
    }

    void FITKRadiossSolverAdaptiveDynamicRelaxation::setEnableStopTime(const bool isEnable)
    {
        _enableStopTime = isEnable;
    }

    bool FITKRadiossSolverAdaptiveDynamicRelaxation::isEnableStopTime() const
    {
        return _enableStopTime;
    }

    void FITKRadiossSolverAdaptiveDynamicRelaxation::setStopTime(const double time)
    {
        _stopTime = time;
    }

    double FITKRadiossSolverAdaptiveDynamicRelaxation::getStopTime() const
    {
        return _stopTime;
    }

    void FITKRadiossSolverAMSElementalTimeStepControlParam::setEnableCriticalTimeStepScaleFactor(const bool isEnable)
    {
        _isEnableCriticalTimeStepScaleFactor = isEnable;
    }

    bool FITKRadiossSolverAMSElementalTimeStepControlParam::isEnableCriticalTimeStepScaleFactor() const
    {
        return _isEnableCriticalTimeStepScaleFactor;
    }

    void FITKRadiossSolverAMSElementalTimeStepControlParam::setCriticalTimeStepScaleFactor(const double value)
    {
        _criticalTimeStepScaleFactor = value;
    }
    double FITKRadiossSolverAMSElementalTimeStepControlParam::getCriticalTimeStepScaleFactor() const
    {
        return _criticalTimeStepScaleFactor;
    }

    void FITKRadiossSolverAMSElementalTimeStepControlParam::setEnableMinTimeStep(const bool isEnable)
    {
        _isEnableMinTimeStep = isEnable;
    }
    bool FITKRadiossSolverAMSElementalTimeStepControlParam::isEnableMinTimeStep() const
    {
        return _isEnableMinTimeStep;
    }

    void FITKRadiossSolverAMSElementalTimeStepControlParam::setMinTimeStep(const double value)
    {
        _minTimeStep = value;
    }
    double FITKRadiossSolverAMSElementalTimeStepControlParam::getMinTimeStep() const
    {
        return _minTimeStep;
    }

    void FITKRadiossSolverAMSElementalTimeStepControlParam::setEnableAMSConvergenceTolerance(const bool isEnable)
    {
        _isEnableAMSConvergenceTolerance = isEnable;
    }
    bool FITKRadiossSolverAMSElementalTimeStepControlParam::isEnableAMSConvergenceTolerance() const
    {
        return _isEnableAMSConvergenceTolerance;
    }

    void FITKRadiossSolverAMSElementalTimeStepControlParam::setAMSConvergenceTolerance(const double value)
    {
        _AMSConvergenceTolerance = value;
    }
    double FITKRadiossSolverAMSElementalTimeStepControlParam::getAMSConvergenceTolerance() const
    {
        return _AMSConvergenceTolerance;
    }

    void FITKRadiossSolverAMSElementalTimeStepControlParam::setEnableMaxIterationsConjugateGradient(const bool isEnable)
    {
        _isEnableMaxIterationsConjugateGradient = isEnable;
    }
    bool FITKRadiossSolverAMSElementalTimeStepControlParam::isEnableMaxIterationsConjugateGradient() const
    {
        return _isEnableMaxIterationsConjugateGradient;
    }

    void FITKRadiossSolverAMSElementalTimeStepControlParam::setMaxIterationsConjugateGradient(const double value)
    {
        _maxIterationsConjugateGradient = value;
    }
    double FITKRadiossSolverAMSElementalTimeStepControlParam::getMaxIterationsConjugateGradient() const
    {
        return _maxIterationsConjugateGradient;
    }

    void FITKRadiossSolverAMSElementalTimeStepControlParam::setEnableNumberOfAdditionalOutputs(const bool isEnable)
    {
        _isEnableNumberOfAdditionalOutputs = isEnable;
    }
    bool FITKRadiossSolverAMSElementalTimeStepControlParam::isEnableNumberOfAdditionalOutputs() const
    {
        return _isEnableNumberOfAdditionalOutputs;
    }

    void FITKRadiossSolverAMSElementalTimeStepControlParam::setNumberOfAdditionalOutputs(const double value)
    {
        _numberOfAdditionalOutputs = value;
    }
    double FITKRadiossSolverAMSElementalTimeStepControlParam::getNumberOfAdditionalOutputs() const
    {
        return _numberOfAdditionalOutputs;
    }

    void FITKRadiossSolverComputationControlParam::setStopComputationWhenNegativeVolume(const bool isStop)
    {
        _stopComputationWhenNegativeVolume = isStop;
    }

    bool FITKRadiossSolverComputationControlParam::getStopComputationWhenNegativeVolume() const
    {
        return _stopComputationWhenNegativeVolume;
    }

    void FITKRadiossSolverComputationControlParam::setParallelArithmetic(const bool isParallel)
    {
        _parallelArithmetic = isParallel;
    }

    bool FITKRadiossSolverComputationControlParam::getParallelArithmetic() const
    {
        return _parallelArithmetic;
    }

    void FITKRadiossSolverConvergenceCriteriaParam::setStopComputation(const bool state)
    {
        _stopComputation = state;
    }

    bool FITKRadiossSolverConvergenceCriteriaParam::getStopComputation() const
    {
        return _stopComputation;
    }

    void FITKRadiossSolverConvergenceCriteriaParam::setEnergyErrorRatio(const double value)
    {
        _energyErrorRatio = value;
    }
    double FITKRadiossSolverConvergenceCriteriaParam::getEnergyErrorRatio() const
    {
        return _energyErrorRatio;
    }

    void FITKRadiossSolverConvergenceCriteriaParam::setTotalMassRatio(const double value)
    {
        _totalMassRatio = value;
    }
    double FITKRadiossSolverConvergenceCriteriaParam::getTotalMassRatio() const
    {
        return _totalMassRatio;
    }

    void FITKRadiossSolverConvergenceCriteriaParam::setNodalMassRatio(const double value)
    {
        _nodalMassRatio = value;
    }
    double FITKRadiossSolverConvergenceCriteriaParam::getNodalMassRatio() const
    {
        return _nodalMassRatio;
    }

    void FITKRadiossSolverConvergenceCriteriaParam::setWriteTimeHistoryFile(const bool state)
    {
        _writeTimeHistoryFile = state;
    }
    bool FITKRadiossSolverConvergenceCriteriaParam::getWriteTimeHistoryFile() const
    {
        return _writeTimeHistoryFile;
    }

    void FITKRadiossSolverConvergenceCriteriaParam::setWriteAnimationFile(const bool state)
    {
        _writeAnimationFile = state;
    }
    bool FITKRadiossSolverConvergenceCriteriaParam::getWriteAnimationFile() const
    {
        return _writeAnimationFile;
    }

    void FITKRadiossSolverConvergenceCriteriaParam::setEnergyError(const bool state)
    {
        _energyError = state;
    }
    bool FITKRadiossSolverConvergenceCriteriaParam::getEnergyError() const
    {
        return _energyError;
    }




    FITKRadiossSolverSettings::FITKRadiossSolverSettings()
    {
        _runExeTimeParam = new FITKRadiossSolverRunExeTimeParam;
        _globalTimeParam = new FITKRadiossSolverGlobalTimeParam;
        _nodalTimeStepControlParam = new FITKRadiossSolverNodalTimeStepControlParam;
        _elementalTimeStepControlParam = new FITKRadiossSolverElementalTimeStepControlParam;
        _adaptiveDynamicRelaxation = new FITKRadiossSolverAdaptiveDynamicRelaxation;
        _AMSElementalTimeStepControlParam = new FITKRadiossSolverAMSElementalTimeStepControlParam;
        _computationControlParam = new FITKRadiossSolverComputationControlParam;
        _convergenceCriteriaParam = new FITKRadiossSolverConvergenceCriteriaParam;
    }

    FITKRadiossSolverSettings::~FITKRadiossSolverSettings()
    {
        if (_runExeTimeParam) delete _runExeTimeParam;
        if (_globalTimeParam) delete _globalTimeParam;
        if (_nodalTimeStepControlParam) delete _nodalTimeStepControlParam;
        if (_elementalTimeStepControlParam) delete _elementalTimeStepControlParam;
        if (_adaptiveDynamicRelaxation) delete _adaptiveDynamicRelaxation;
        if (_AMSElementalTimeStepControlParam) delete _AMSElementalTimeStepControlParam;
        if (_computationControlParam) delete _computationControlParam;
        if (_convergenceCriteriaParam) delete _convergenceCriteriaParam;
    }

    FITKRadiossSolverRunExeTimeParam * FITKRadiossSolverSettings::getRunExeTimeParam()
    {
        return _runExeTimeParam;
    }

    FITKRadiossSolverGlobalTimeParam * FITKRadiossSolverSettings::getGlobalTimeParam()
    {
        return _globalTimeParam;
    }

    FITKRadiossSolverNodalTimeStepControlParam * FITKRadiossSolverSettings::getNodalTimeStepControlParam()
    {
        return _nodalTimeStepControlParam;
    }

    FITKRadiossSolverElementalTimeStepControlParam * FITKRadiossSolverSettings::getElementalTimeStepControlParam()
    {
        return _elementalTimeStepControlParam;
    }

    FITKRadiossSolverAdaptiveDynamicRelaxation * FITKRadiossSolverSettings::getAdaptiveDynamicRelaxation()
    {
        return _adaptiveDynamicRelaxation;
    }

    FITKRadiossSolverAMSElementalTimeStepControlParam * FITKRadiossSolverSettings::getAMSElementalTimeStepControlParam()
    {
        return _AMSElementalTimeStepControlParam;
    }

    FITKRadiossSolverComputationControlParam * FITKRadiossSolverSettings::getComputationControlParam()
    {
        return _computationControlParam;
    }

    FITKRadiossSolverConvergenceCriteriaParam * FITKRadiossSolverSettings::getConvergenceCriteriaParam()
    {
        return _convergenceCriteriaParam;
    }

} // namespace Radioss

